home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
System
/
CADAR
/
Symbols
/
Other
/
list-a-scale
< prev
next >
Wrap
Text File
|
1998-10-22
|
676b
|
36 lines
list-a-scale start length
&key (scr 1) (type 0)
legal types are 0 :pal and :rev
a simple little function that I use a lot to produce
scales of symbols or integer-lists
(list-a-scale 'a 12)
->(a b c d e f g h i j k l)
(list-a-scale 0 12)
->(0 1 2 3 4 5 6 7 8 9 10 11)
(list-a-scale 0 12 :scr 3)
->(0 3 6 9 12 15 18 21 24 27 30 33)
type :pal makes a palindrome
(list-a-scale 0 5 :scr 2 :type :pal)
->(0 2 4 6 8 6 4 2 0)
(list-a-scale 0 5 :type 'foo-)
->(foo-0 foo-1 foo-2 foo-3 foo-4)
type :rev reverses the list
(list-a-scale 0 5 :type :rev)
->(4 3 2 1 0)
with a symbol you create names
(list-a-scale 'a 7 :scr 3 :type 'foo)
->(fooa food foog fooj foom foop foos)